#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=5e5+5;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=(x<<1)+(x<<3)+ch-48,ch=getchar();}
	return x*f;
}
int n,q,a[N],sum[N];
int f[N];

signed main(){
	freopen("pockets.in","r",stdin);
	freopen("pockets.out","w",stdout);
	n=read();
	for(int i=1;i<n;i++) a[i]=read();
	for(int i=1;i<n;i++) sum[i]=sum[i-1]+a[i];
	q=read();
	while(q--){
		int x=read();
		if(x>sum[n-1]-sum[2]){
			printf("%lld\n",a[1]+x-(sum[n-1]-a[1]));
			continue;
		}
		a[n]=x;
		sum[n]=sum[n-1]+a[n];
		int mx=-1e16;
		for(int i=n;i>=1;i--){
			f[i]=mx+sum[i];
			if(i==n) f[i]=0;
			mx=max(mx,2*a[i]-sum[i]-f[i]);
		}
		printf("%lld\n",a[1]+f[2]-a[2]);
	}
	return 0;
}